Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QA for home UI and markdown text #35

Merged
merged 3 commits into from
Nov 18, 2024
Merged

QA for home UI and markdown text #35

merged 3 commits into from
Nov 18, 2024

Conversation

nahbee10
Copy link

@nahbee10 nahbee10 commented Nov 18, 2024

Description

  • applied style to the markdown text elements(heading, paragraph, footnote, divider, blockquote, sup, link, inline code)
  • fixed button width issue on newsletter signup button

Type(s) of changes

  • Bug fix
  • New feature
  • Update to an existing feature

Motivation for PR

How Has This Been Tested?

Tested on local and preview

Applicable screenshots

Follow-up PR

Summary by CodeRabbit

  • New Features

    • Enhanced button styling in the Newsletter Form for improved responsiveness on different screen sizes.
    • Introduced a new class for documentation styling, improving the visual layout and presentation of headings and other elements.
    • Increased spacing above the Sentiment Tracking component for better layout.
    • Improved vertical spacing within the Article Link Card on the homepage.
    • Default theme set to 'light' when no theme is stored, enhancing user experience.
  • Bug Fixes

    • Adjusted padding and scrolling behavior for better user experience in documentation sections.

Copy link

vercel bot commented Nov 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
uniswap-docs-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 18, 2024 10:23pm

Copy link

coderabbitai bot commented Nov 18, 2024

Walkthrough

The changes in this pull request involve updates to the NewsletterForm component, the SentimentTracking component, and the custom.css stylesheet. In the NewsletterForm, the button's class attributes were modified for improved responsiveness. The SentimentTracking component received a margin adjustment. The CSS file updates include adding smooth scrolling behavior, padding adjustments for the .container class, and introducing a new .theme-doc-markdown class with nested styles for various HTML elements to enhance markdown text styling.

Changes

File Change Summary
src/components/NewsletterForm/index.tsx Updated button class attributes for responsive width and padding adjustments.
src/components/SentimentTracking/index.tsx Added margin-top utility class to outer <div> for spacing adjustments.
src/css/custom.css - Added smooth scrolling for .theme-doc-markdown class.
- Updated padding for .container class.
- Introduced .theme-doc-markdown class with nested styles for various elements.
src/pages/index.tsx Altered internal structure of ArticleLinkCard and updated divider elements for improved layout.
src/components/ThemeSwitch/index.tsx Set theme state to 'light' if no current theme is stored.

Assessment against linked issues

Objective Addressed Explanation
Markdown text styling (6)
- Headings
- Paragraph style
- Inline code
- Block quote

Possibly related PRs

  • feat: add navigation #30: The changes in the NewsletterForm component's button styling may relate to the overall UI enhancements introduced in the navigation and footer elements, as both involve adjustments to user interface components.
  • feat: add home UI #34: The introduction of the NewsletterForm component in the home UI aligns with the overall focus on enhancing the user interface, particularly in how components are structured and styled within the home page layout.

Suggested reviewers

  • limsohee1002

Poem

In a world of forms and styles so bright,
A button now stretches, a marvelous sight!
With markdowns dancing, in flex they align,
Our CSS sings, everything's looking fine!
So hop along, let’s celebrate this cheer,
For every change brings us closer, my dear! 🐇✨


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

⚡️ Lighthouse Report

Mobile (view report)

Category Score
🟠 Performance 70
🟢 Accessibility 96
🟠 Best practices 83
🟠 SEO 85

Desktop (view report)

Category Score
🟢 Performance 99
🟢 Accessibility 96
🟠 Best practices 83
🟠 SEO 82

Lighthouse ran on https://uniswap-docs-staging-c8k16eprp-uniswap.vercel.app

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (2)
src/components/NewsletterForm/index.tsx (1)

Line range hint 68-72: Consider organizing Tailwind classes for better maintainability

The button styling changes correctly address the width issue mentioned in the PR objectives. However, the class string could be better organized for maintainability.

Consider grouping related classes:

-          <button className="group mt-2 flex items-center justify-center rounded-large bg-light-pink-vibrant p-3 sm:w-32 transition hover:bg-dark-accent-2 dark:bg-dark-pink-vibrant hover:dark:bg-light-accent-2 sm:ml-2 sm:mt-0 w-full px-0 sm:px-3">
+          <button className="group
+            // Layout & Spacing
+            flex items-center justify-center w-full sm:w-32
+            mt-2 sm:mt-0 sm:ml-2 px-0 sm:px-3 p-3
+            // Visual
+            rounded-large
+            // Colors & Transitions
+            bg-light-pink-vibrant dark:bg-dark-pink-vibrant
+            hover:bg-dark-accent-2 hover:dark:bg-light-accent-2
+            transition">

This organization:

  1. Groups related properties (layout, spacing, visual, colors)
  2. Improves code readability
  3. Makes future maintenance easier
src/css/custom.css (1)

144-146: Consider consolidating duplicate .theme-doc-markdown selectors

The .theme-doc-markdown selector is defined twice. Consider consolidating them for better maintainability:

.theme-doc-markdown {
  @apply !body-2 flex flex-col space-y-6;

-}
-.theme-doc-markdown {
  h1 {
    @apply !heading-1 !mb-0 md:!pt-8 !pt-6;
  }
  // ... rest of the styles ...
}

Also applies to: 147-190

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between af87fea and 2e33137.

📒 Files selected for processing (2)
  • src/components/NewsletterForm/index.tsx (1 hunks)
  • src/css/custom.css (2 hunks)
🧰 Additional context used
🪛 Biome
src/css/custom.css

[error] 21-22: An empty block isn't allowed.

Consider removing the empty block or adding styles inside it.

(lint/suspicious/noEmptyBlock)

🔇 Additional comments (3)
src/css/custom.css (3)

18-20: LGTM: Smooth scrolling enhancement

Good addition of smooth scrolling behavior for better user experience when navigating between anchor links in the documentation.


136-136: LGTM: Responsive padding implementation

Good use of Tailwind's responsive utilities to handle different padding values across breakpoints.


144-190: LGTM: Comprehensive markdown styling implementation

Excellent implementation of markdown text styling that:

  • Addresses all requirements from issue Markdown Text styling #6
  • Provides consistent styling for all markdown elements
  • Handles responsiveness appropriately
  • Uses semantic class names and follows project conventions

Comment on lines 21 to 22
.container {
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove empty container class block

The empty .container class block should be removed as it serves no purpose. The actual styles for this class are defined later in the file (line 136).

-.container {
-}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.container {
}
🧰 Tools
🪛 Biome

[error] 21-22: An empty block isn't allowed.

Consider removing the empty block or adding styles inside it.

(lint/suspicious/noEmptyBlock)

Copy link

⚡️ Lighthouse Report

Mobile (view report)

Category Score
🟠 Performance 81
🟢 Accessibility 96
🟠 Best practices 83
🟠 SEO 85

Desktop (view report)

Category Score
🟢 Performance 97
🟢 Accessibility 96
🟠 Best practices 83
🟠 SEO 82

Lighthouse ran on https://uniswap-docs-staging-d8h76cp2k-uniswap.vercel.app

@nahbee10 nahbee10 merged commit 83b68a9 into main Nov 18, 2024
5 of 6 checks passed
Copy link

⚡️ Lighthouse Report

Mobile (view report)

Category Score
🟠 Performance 86
🟢 Accessibility 96
🟠 Best practices 83
🟠 SEO 85

Desktop (view report)

Category Score
🟢 Performance 98
🟢 Accessibility 96
🟢 Best practices 92
🟠 SEO 82

Lighthouse ran on https://uniswap-docs-staging-rljkpe849-uniswap.vercel.app

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
src/components/ThemeSwitch/index.tsx (1)

19-19: Consider respecting system color scheme preferences

The explicit default to 'light' theme works, but consider enhancing user experience by respecting system preferences.

Consider this enhancement:

 if (!currentTheme) {
+  const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches
+  const defaultTheme = prefersDark ? 'dark' : 'light'
-  ThemeManager.set('light')
-  setTheme('light')
+  ThemeManager.set(defaultTheme)
+  setTheme(defaultTheme)
 } else {
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 36ec2d9 and 057e684.

📒 Files selected for processing (2)
  • src/components/NewsletterForm/index.tsx (1 hunks)
  • src/components/ThemeSwitch/index.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/NewsletterForm/index.tsx
🔇 Additional comments (1)
src/components/ThemeSwitch/index.tsx (1)

Line range hint 13-24: Verify SSR hydration consistency

The current implementation might cause hydration mismatches during SSR. Let's verify if there are any SSR-specific files or configurations that need to be updated.

Copy link

⚡️ Lighthouse Report

Mobile (view report)

Category Score
🟠 Performance 56
🟢 Accessibility 96
🟢 Best practices 92
🟠 SEO 85

Desktop (view report)

Category Score
🟢 Performance 98
🟢 Accessibility 96
🟢 Best practices 92
🟠 SEO 82

Lighthouse ran on https://uniswap-docs-staging-15cheipo5-uniswap.vercel.app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Markdown Text styling
1 participant